//同步获取系统信息
const SYSTEM_INFO = uni.getSystemInfoSync();
export const getStatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight || 15;

//获取小程序胶囊按钮的布局信息
export const getTitleBarHeight = () => {
    if (uni.getMenuButtonBoundingClientRect) {
        let { top, height } = uni.getMenuButtonBoundingClientRect();
        return height + (top - getStatusBarHeight());
    } else {
        return 50; // 默认值
    }
};



export const getNavBarHeight = ()=> getStatusBarHeight()+getTitleBarHeight();

//获取抖音小程序的logo位置
export const getLeftIcon =()=>{
	// #ifdef MP-TOUTIAO
		let {leftIcon:{left,width}} = tt.getCustomButtonBoundingClientRect();
		return left + parseInt(width) + 5
	// #endif
	
	// #ifndef MP-TOUTIAO
		return 0 
	// #endif
	
}
